import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
import Layout from '@/views/layout/Layout';

//如首页和登录页和一些不用权限的公用页面
export const constantRouterMap = [
    /* 登陆 */
    {
        path: '/index',
        name:'index',
        component: () => import('@/views/index/index.vue'),
    },
    {
        path: '/404',
        name:'404',
        component: () => import('@/views/404.vue'),
        hidden: true
    },
    {
        path: '/pageAbility/detail',
        name:'ability_detail',
        component: () => import('@/views/pageAbility/detail.vue'),
        hidden: true
    },
    {
        path: '/home/detail',
        name:'home_detail',
        component: () => import('@/views/home/detail.vue'),
        hidden: true
    },
    {
        path: "",
        component: Layout,
        name:'home',
        redirect: "home",
        children: [
            {
                path: "home",
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: "监控",
                    icon: "home",
                }
            },
        ]
    },
    {
        path: "/pageAbility",
        component: Layout,
        meta: {
            title: "能力",
            icon: "articleManage",
            breadcrumb:false
        },
        children: [
            {
                path: 'overview',
                component: () => import('@/views/pageAbility/overview.vue'),
                name: 'overview',
                meta: { title: '综述'}
            },
            {
                path: 'analysis',
                component: () => import('@/views/pageAbility/analysis.vue'),
                name: 'analysis',
                meta: { title: '分析'}
            },
        ]
    },
    {
        path: "",
        component: Layout,
        name:'picture',
        redirect: "picture",
        children: [
            {
                path: "picture",
                component: () => import('@/views/picture/index.vue'),
                meta: {
                    title: "图片管理",
                    icon: "templateManage",
                }
            },
        ]
    },

    {
        path: "/manager",
        component: Layout,
        meta: {
            title: "权限管理",
            icon: "designerManage",
            breadcrumb:false
        },
        children: [
            {
                path: 'role',
                component: () => import('@/views/manager/role.vue'),
                name: 'role',
                meta: { title: '角色管理'}
            },
            {
                path: 'account',
                component: () => import('@/views/manager/account.vue'),
                name: 'account',
                meta: { title: '账号管理'}
            },
            {
                path: 'menu',
                component: () => import('@/views/manager/menu.vue'),
                name: 'menu',
                meta: { title: '菜单管理' }
            }
        ]
    },
    {
        path: "/settings",
        component: Layout,
        meta: {
            title: "设置",
            icon: "manager",
            breadcrumb:false
        },
        children: [
            {
                path: 'upAndLowSettings',
                component: () => import('@/views/settings/upAndLowSettings.vue'),
                name: 'upAndLowSettings',
                meta: { title: '上限/下限设置'}
            },
            {
                path: 'targetSet',
                component: () => import('@/views/settings/targetSet.vue'),
                name: 'targetSet',
                meta: { title: 'cp/cpk目标设置'}
            },
            {
                path: 'attributesSet',
                component: () => import('@/views/settings/attributesSet.vue'),
                name: 'attributesSet',
                meta: { title: '属性设置'}
            },
            {
                path: 'statisSet',
                component: () => import('@/views/settings/statisSet.vue'),
                name: 'statisSet',
                meta: { title: '统计设置'}
            },
            {
                path: 'dataManage',
                component: () => import('@/views/settings/dataManage.vue'),
                name: 'dataManage',
                meta: { title: '数据管理'}
            },
            {
                path: 'detection',
                component: () => import('@/views/settings/detection.vue'),
                name: 'detection',
                meta: { title: '检测特征'}
            },
            {
                path: 'job',
                component: () => import('@/views/settings/job.vue'),
                name: 'job',
                meta: { title: '云之家消息配置'}
            },
            {
                path: 'jobLog',
                component: () => import('@/views/settings/jobLog.vue'),
                name: 'jobLog',
                meta: { title: '云之家消息发送日志'}
            },
        ]
    },
    {
        path: "/resume",
        component: Layout,
        name:'resume',
        redirect: "resume",
        children: [
            {
                path: "resume",
                component: () => import('@/views/resume/index.vue'),
                meta: {
                    title: "履历表",
                    icon: "orderManage",
                }
            },
        ]
    },
]
export default new Router({
	routes: constantRouterMap,
    scrollBehavior: () => ({ y: 0 }),
});

